<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="pojo.GuestDto"  %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>checkIn</title>
    <link rel="stylesheet" href="checkIn.css">
    <script src="checkIn.js"></script>
</head>
<body class="bodyType">
  <div class="title">
    <samp>入住登记</samp>
  </div>
  <div style="width: 1000px;">
    <form  action="queryMoneyServlet" method="post">
      <div class="total">
        <div class="checkInTitel">
         	 入住信息
        </div>
        <hr style="color: #f1f1f1; width: 100%;">
        <div class="userCondition">
           <%	
          		String message = (String)session.getAttribute("querMoneyMassage");
          		if(message == null){
          		%>
          		<label for="guestName">姓名：</label>
          <input type="text" style="width:  81px;" name="guestName" id="guestName">  
          <label for="sex" style="padding-left: 36px;">性别：</label>
          <select name="sex" id="sex">
            <option value="男">男</option>
            <option value="女">女</option>
          </select>
          <label for="identity" style="padding-left: 39px;">身份证：</label>
          <input type="text"  name="identity" id="identity">
          <label for="tel" style="padding-left: 39px;">电话号码：</label>
          <input type="text" name="tel" id="tel">
  
          <div class="roomDiv" >
            <label for="roomType">房间类型：</label>
            <select name="roomType" id="roomType">
              <option value="豪华套房">豪华套房</option>
              <option value="单人房">单人房</option>
              <option value="标准房">标准房</option>
              <option value="高级标间">高级标间</option>
              <option value="三人间">三人间</option>
            </select>
            <label for="roomNum" style="padding-left: 39px;" >房号：</label>
            <input type="text" name="roomNum" id="roomNum">
  
            <label for="perDay" style="padding-left: 39px;">入住天数：</label>
            <input type="text" name="perDay" id="perDay">
           </div>
           <div class="roomDiv">
            <label for="">应预缴：</label>
            <div id="perpay" class="perpay"></div>
            <label for="" style="padding-left: 36px;">总额：</label>
            <div id="perpay" class="perpay"></div>
            <input type="submit" value="查询" id="select">
          </div>
          		
          <%
          		}else if(message == "error"){
          		
          		%>
          		<label for="guestName">姓名：</label>
          <input type="text" style="width:  81px;" name="guestName" id="guestName">  
          <label for="sex" style="padding-left: 36px;">性别：</label>
          <select name="sex" id="sex">
            <option value="男">男</option>
            <option value="女">女</option>
          </select>
          <label for="identity" style="padding-left: 39px;">身份证：</label>
          <input type="text"  name="identity" id="identity">
          <label for="tel" style="padding-left: 39px;">电话号码：</label>
          <input type="text" name="tel" id="tel">
  
          <div class="roomDiv" >
            <label for="roomType">房间类型：</label>
            <select name="roomType" id="roomType">
              <option value="豪华套房">豪华套房</option>
              <option value="单人房">单人房</option>
              <option value="标准房">标准房</option>
              <option value="高级标间">高级标间</option>
              <option value="三人间">三人间</option>
            </select>
            <label for="roomNum" style="padding-left: 39px;" >房号：</label>
            <input type="text" name="roomNum" id="roomNum">
  
            <label for="perDay" style="padding-left: 39px;">入住天数：</label>
            <input type="text" name="perDay" id="perDay">
           </div>
           <div class="roomDiv">
            <label for="">应预缴：</label>
            <div id="perpay" class="perpay"><%="输入有误" %></div>
            <label for="" style="padding-left: 36px;">总额：</label>
            <div id="perpay" class="perpay"><%="输入有误" %></div>
            <input type="submit" value="查询" id="select">
          </div>
          		
          <%
          }else if(message == "succeed"){
          		GuestDto guest = (GuestDto)session.getAttribute("fistGuest");
          	
          		
          	%>
          		<label for="guestName">姓名：</label>
          <input type="text" style="width:  81px;" name="guestName" id="guestName" value=<%=guest.name %>>  
          <label for="sex" style="padding-left: 36px;">性别：</label>
          <select name="sex" id="sex" value=<%=guest.sex %>>
            <option value="男">男</option>
            <option value="女">女</option>
          </select>
          <label for="identity" style="padding-left: 39px;">身份证：</label>
          <input type="text"  name="identity" id="identity" value=<%=guest.id %>>
          <label for="tel" style="padding-left: 39px;">电话号码：</label>
          <input type="text" name="tel" id="tel" value=<%=guest.tel %>>
  
          <div class="roomDiv" >
            <label for="roomType">房间类型：</label>
            <select name="roomType" id="roomType" value=<%=guest.roomType %>>
              <option value="豪华套房">豪华套房</option>
              <option value="单人房">单人房</option>
              <option value="标准房">标准房</option>
              <option value="高级标间">高级标间</option>
              <option value="三人间">三人间</option>
            </select>
            <label for="roomNum" style="padding-left: 39px;" >房号：</label>
            <input type="text" name="roomNum" id="roomNum" value=<%=guest.roomNum %>>
  
            <label for="perDay" style="padding-left: 39px;">入住天数：</label>
            <input type="text" name="perDay" id="perDay" value=<%=guest.perDay %>>
           </div>
           <div class="roomDiv">
            <label for="">应预缴：</label>
            <div id="perpay" class="perpay"><%=guest.perPay %></div>
            <label for="" style="padding-left: 36px;">总额：</label>
            <div id="perpay" class="perpay"><%=guest.paid %></div>
            <input type="submit" value="查询" id="select">
          </div>
          		
          <%
          }
          		
           %>
        </div>
      </div>
    </form>
    
    <form action="checkInServlet" method="post">
      <!-- 加载其他同伴 -->
      <div class="total">
        <div class="checkInTitel">
          其他同伴信息
        </div>
        <hr style="color: #f1f1f1; width: 100%;">
  
        <!-- 同伴一 -->
        <div class="userCondition">
          <label for="guestName1">姓名：</label>
          <input type="text" style="width:  81px;" name="guestName1" id="guestName1">  
          <label for="sex1" style="padding-left: 36px;">性别：</label>
          <select name="sex1" id="sex1">
            <option value="男">男</option>
            <option value="女">女</option>
          </select>
          <label for="identity1" style="padding-left: 39px;">身份证：</label>
          <input type="text" name="identity1" id="identity1">
          <div class="telStyle">
            <label for="tel1">电话号码：</label>
            <input type="text" name="tel1" id="tel1">
            <input type="button" onclick="addGuest()" style="width: 50px; height: 26px; margin-left: 27px;" value="添加">
          </div>
        </div>
  
        <!-- 同伴二 -->
        <div class="userCondition userCondition2" id="userCondition2">
          <label for="guestName2">姓名：</label>
          <input type="text" style="width:  81px;" name="guestName2" id="guestName2">  
          <label for="sex2" style="padding-left: 36px;">性别：</label>
          <select name="sex2" id="sex2">
            <option value="男">男</option>
            <option value="女">女</option>
          </select>
          <label for="identity2" style="padding-left: 39px;">身份证：</label>
          <input type="text" name="identity2" id="identity2">
          <div class="telStyle">
            <label for="tel2">电话号码：</label>
            <input type="text" name="tel2" id="tel2">
            <input type="button" onclick="addGuest()" style="width: 50px; height: 26px; margin-left: 27px;" value="添加">
          </div>
        </div>
  
        <!-- 同伴三 -->
        <div class="userCondition userCondition3" id="userCondition3">
          <label for="guestName3">姓名：</label>
          <input type="text" style="width:  81px;" name="guestName3" id="guestName3">  
          <label for="sex3" style="padding-left: 36px;">性别：</label>
          <select name="sex3" id="sex3">
            <option value="男">男</option>
            <option value="女">女</option>
          </select>
          <label for="identity3" style="padding-left: 39px;">身份证：</label>
          <input type="text" name="identity3" id="identity3">
          <div class="telStyle">
            <label for="tel3">电话号码：</label>
            <input type="text" name="tel3" id="tel3">
            <input type="button" onclick="addGuest()" style="width: 50px; height: 26px; margin-left: 27px;" value="添加">
          </div>
        </div>
        <!-- 同伴四 -->
        <div class="userCondition userCondition4" id="userCondition4">
          <label for="guestName4">姓名：</label>
          <input type="text" style="width:  81px;" name="guestName4" id="guestName4">  
          <label for="sex4" style="padding-left: 36px;">性别：</label>
          <select name="sex4" id="sex4">
            <option value="男">男</option>
            <option value="女">女</option>
          </select>
          <label for="identity4" style="padding-left: 39px;">身份证：</label>
          <input type="text" name="identity4" id="identity4">
          <div class="telStyle">
            <label for="tel4">电话号码：</label>
            <input type="text" name="tel4" id="tel4">
            <input type="button" onclick="addGuest()" style="width: 50px; height: 26px; margin-left: 27px;" value="添加">
          </div>
        </div>
  
        <!-- 同伴五 -->
        <div class="userCondition userCondition5" id="userCondition5">
          <label for="guestName5">姓名：</label>
          <input type="text" style="width:  81px;" name="guestName5" id="guestName5">  
          <label for="sex5" style="padding-left: 36px;">性别：</label>
          <select name="sex5" id="sex5">
            <option value="男">男</option>
            <option value="女">女</option>
          </select>
          <label for="identity5" style="padding-left: 39px;">身份证：</label>
          <input type="text" name="identity5" id="identity5">
          <div class="telStyle">
            <label for="tel5">电话号码：</label>
            <input type="text" name="tel5" id="tel5">
          </div>
        </div>
        
        <div class="userCondition">
          <input type="submit" name="submit" onclick="submitInformation()" value="提交信息">
        </div>
      </div>
    </form>
  </div>
</body>
</html>